<?php
//用于写Company各个网站统一的函数
include_once('public_function.php');
class PublicCompany extends PublicFunction {
	function __construct($arr = NULL){
		
	}
	//得到年份列表  
	function year_list($db,$get = array() )
	{
		$cur_year = empty($get['cur_year'])?'2011':trim(htmlspecialchars($get['cur_year']));
		$str = '';
		$sql ='SELECT url,Field_21542 FROM  Table_127 ORDER BY  Field_21542   DESC   ';
		$res = $db->query($sql);
		while ($rows = $db->fetch_array($res)) {
			$styleClass = '';
			$url = str_replace(array('/wondershare.com/httpdocs','/index.html'),array('http://www.wondershare.com',''),$rows['url']);
			if($rows['Field_21542'] == $cur_year )
			{
				$styleClass = 'class="active"';
			}
			$str .= '<li '.$styleClass.'><a href="'.$url.'">'.$rows['Field_21542'].'</a></li>';
		}
		unset($row);
		return  $str;	
	}
}
?>